<?php
namespace app\admin\validate;
use think\Validate;

/**
 * Created by PhpStorm.
 * User: HuangLuSen
 * Date: 2017/5/4
 * Time: 19:36
 */
class Ygroup extends Validate
{
    protected $rule = [
        'group_name'     =>  'require|token',
        'depar_id'  =>  'require',
    ];
    protected $message =[
        'group_name.require'=>'邀约分组名称不能为空',
        'depar_id.require'=>'部门必选',
    ];
    protected $scene = [
        'edit'  =>  [
            'group_name'=>'require|unique:ygroup,group_name^id',
            'depar_id',
        ]
    ];
}